<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * pelamarlowongan.php
 * @author ranuandra
 *
 * 12 Mar 2012 14:19:34
 *
 * 
 */
class Model_Pelamarlowongan extends ORM
{
	protected $_belongs_to = array(
							'mstlowongan'		=> array('model' 	=> 'mstlowongan'),
							'mstpelamar' 		=> array('model'	=> 'mstpelamar'),
							
						);
	protected $_has_many = array(
							'pelamarproses'		=> array('model' 	=> 'pelamarproses'),
						);
	private $_field = array('kode_lamaran', 'mstpelamar_id', 'tgl_apply', 'flag_panggil', 'tgl_panggil', 'flag_datang', 'alamat_panggil', 'flag_sms', 'mstproses_id');
	private $_form = array(
	
							'kode_lamaran' => '', 
							'mstpelamar_id' => '',
							'tgl_apply' => '', 
							'flag_panggil' => '', 
							'tgl_panggil'  => '', 
							'flag_datang'  => '', 
							'alamat_panggil'  => '', 
							'flag_sms'  => '', 
							'mstproses_id'  => '',
				);
	
	public function rules()
	{
		return array(
					'kode_lamaran' => array(
											array('min_length', array(':value', 0)),
											), 
					'mstpelamar_id' => array(
											array('min_length', array(':value', 0)),
											),
					'tgl_apply' => array(
											array('min_length', array(':value', 0)),
											), 
					'flag_panggil' => array(
											array('min_length', array(':value', 0)),
											), 
					'tgl_panggil'  => array(
											array('min_length', array(':value', 0)),
											), 
					'flag_datang'  => array(
											array('min_length', array(':value', 0)),
											), 
					'alamat_panggil'  => array(
											array('min_length', array(':value', 0)),
											), 
					'flag_sms'  => array(
											array('min_length', array(':value', 0)),
											), 
					'mstproses_id'  => array(
											array('min_length', array(':value', 0)),
											),
		
		); 
	}
	
	public function getField()
	{
		return $this->_field;
	}
	
	public function getForm()
	{
		return $this->_form;
	}
	
	public function create_data($values)
	{
	    return $this->values($values, $this->_field)->create();
	}	
}